<template>
 <div>
    <router-view></router-view>
    <van-tabs v-model="active" sticky >
      <van-tab v-for="(item, index) in own" :key="index" :title="item.name">
      </van-tab>
    </van-tabs>
 </div>
</template>

<script>
import { getOwn } from '@/api/article'
export default {

  name: 'article-page',
  data () {
    return {
      active: 0,
      list: [],
      own: [],
      channel_id: 0,
      timestamp: +new Date()
    }
  },
  async created () {
    this.getlist()
  },
  methods: {
    async getlist () {
      const res = await getOwn()
      this.own = res.data.channels
      console.log(res)
    }
  }
}
</script>

<style lang="less" scoped>
.article-page {
  background: #f5f5f5;
}
.article-item {
  margin-bottom: 10px;
  background: #fff;
  padding: 10px 15px;
  .head {
    display: flex;
    img {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      overflow: hidden;
    }
    .con {
      flex: 1;
      overflow: hidden;
      padding-left: 15px;
      p {
        margin: 0;
        line-height: 1.5;
        &.title {
          text-overflow: ellipsis;
          overflow: hidden;
          width: 100%;
          white-space: nowrap;
        }
        &.other {
          font-size: 10px;
          color: #999;
        }
      }
    }
  }
  .body {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-top: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .foot {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
  }
}
</style>
